Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace extendSetMaybe by extendSet and bring the checks at the calling point (for performance) #106

Merged
merged 2 commits into from
Jul 21, 2022

Conversation

lemire
Copy link
Member

@lemire lemire commented Jul 21, 2022

The 'extendSetMaybe' function is seemingly not inlined in Go. Yet it is systematically called when we set values, to check whether the backing array need to be extended.

By bringing the check (the branch) in the calling function, we reduce the number of function calls.

This leads to a ~10% performance gain in some benchmarks.

lemire and others added 2 commits July 21, 2022 10:11
is systematically called when we set values, to check whether the backing
array need to be extended.

By bringing the check (the branch) in the calling function, we reduce the
number of function calls.

This leads to a ~10% performance gain in some  benchmarks.
@lemire lemire merged commit 8e934f5 into master Jul 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant